/**
 * BBD Service Inc
 * All Rights Reserved @2018
 */
package com.bbd.merchant.guide.galaxy.core;

import com.bbd.merchant.guide.galaxy.core.CommandDirective;
import com.bbd.merchant.guide.galaxy.strategy.AliasCommandStrategy;

import java.lang.reflect.Constructor;

/**
 *
 *
 * @author tianyuliang
 * @version $Id: DirectiveProxy.java, v0.1 2018-08-01 14:57 tianyuliang Exp $$
 */
public class DirectiveProxy<T extends CommandDirective> {

    public static CommandDirective Create(String content) {
        CommandDirective directive = null;
        try {
            Constructor<CommandDirective> constructor = CommandDirective.class.getDeclaredConstructor(String.class);
            constructor.setAccessible(true);
            directive = constructor.newInstance(content);
            return directive;
        } catch (Exception e) {
            //e.printStackTrace();
            return null;
        }
    }

}